package com.example.demo.JSON;

import com.fasterxml.jackson.databind.ObjectMapper;
import java.io.File;
import java.io.IOException;
import java.util.Map;

public class JSONFileReader {
    public Map<String, Object> transfer(String path) {
        ObjectMapper objectMapper = new ObjectMapper();
        File file = new File(path);
        try {
            // 读取JSON文件并转换为Map对象
            Map<String, Object> map = objectMapper.readValue(file, Map.class);
            return map;
        } catch (IOException e) {
            e.printStackTrace();
        }
        return null;
    }
}